var AnimalShelf = function() {
  this.animal = [];
};

/**
 * @param {number[]} animal
 * @return {void}
 */
AnimalShelf.prototype.enqueue = function(animal) {
  let obj = {
    type: animal[1],
    id: animal[0]
  };
  this.animal.push(obj);
};

/**
 * @return {number[]}
 */
AnimalShelf.prototype.dequeueAny = function() {
  if(this.animal.length) {
    let animal = this.animal.shift();
    return [animal.id, animal.type];
  } else {
    return [-1, -1];
  }
};

/**
 * @return {number[]}
 */
AnimalShelf.prototype.dequeueDog = function() {
  for(let i = 0; i < this.animal.length; i++) {
    let animal = this.animal[i];
    if(animal.type) {
      this.animal.splice(i, 1);
      return [animal.id, animal.type];
    }
  }
  return [-1, -1];
};

/**
 * @return {number[]}
 */
AnimalShelf.prototype.dequeueCat = function() {
  for(let i = 0; i < this.animal.length; i++) {
    let animal = this.animal[i];
    if(!animal.type) {
      this.animal.splice(i, 1);
      return [animal.id, animal.type];
    }
  }
  return [-1, -1];
};

/**
 * Your AnimalShelf object will be instantiated and called as such:
 * var obj = new AnimalShelf()
 * obj.enqueue(animal)
 * var param_2 = obj.dequeueAny()
 * var param_3 = obj.dequeueDog()
 * var param_4 = obj.dequeueCat()
 */
